﻿<UserControl x:Class="Daphne.Controls.HoverButton"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Button x:Name="uxButton" OverridesDefaultStyle="True" >           
            <Button.Style>
                <Style TargetType="Button">
                    <Setter Property="BorderThickness" Value="0" />
                    <Setter Property="Focusable" Value="True" />
                    <Setter Property="IsHitTestVisible" Value="True" />
                    <Setter Property="IsManipulationEnabled" Value="True" />
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <Image x:Name="uxImage" Source="{Binding Path=NormalImage}" Focusable="True" IsHitTestVisible="True" IsManipulationEnabled="True">
                                </Image>
                                <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter TargetName="uxImage" Property="Source" Value="{Binding Path=HoverImage}" />
                                    </Trigger>
                                </ControlTemplate.Triggers>
                            </ControlTemplate>
                        </Setter.Value>                        
                    </Setter>
                </Style>
            </Button.Style>
        </Button>
    </Grid>
</UserControl>
